package com.example.SpringBootMybatis.service;

import com.example.SpringBootMybatis.entity.Disease;
import com.example.SpringBootMybatis.entity.Params;
import com.example.SpringBootMybatis.mapper.DiseaseMapper;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DiseaseService {
    @Resource
    private DiseaseMapper diseaseMapper;

    public PageInfo<Disease> findBySearch(Params params){
        PageHelper.startPage(params.getPageNum(),params.getPageSize());
        List<Disease> list=diseaseMapper.findBySearch(params);
        return PageInfo.of(list);
    }
}
